Change-Id: I0d8e6e58c74c3ba849f9cb4a3a159a62049604a3
- function __construct( $name = null, array $data = [], $dataName = '' ) {
+ public function __construct( $name = null, array $data = [], $dataName = '' ) {
parent::__construct( $name, $data, $dataName );
$this->tablesUsed = array_merge( $this->tablesUsed,
parent::__construct( $name, $data, $dataName );
$this->tablesUsed = array_merge( $this->tablesUsed,
$wgContentHandlers['DUMMY'] = 'DummyContentHandlerForTesting';
MWNamespace::clearCaches();
$wgContentHandlers['DUMMY'] = 'DummyContentHandlerForTesting';
MWNamespace::clearCaches();
- $wgContLang->resetNamespaces(); # reset namespace cache
+ // Reset namespace cache
+ $wgContLang->resetNamespaces();
if ( !$this->the_page ) {
$this->the_page = $this->createPage(
'RevisionStorageTest_the_page',
if ( !$this->the_page ) {
$this->the_page = $this->createPage(
'RevisionStorageTest_the_page',
unset( $wgContentHandlers['DUMMY'] );
MWNamespace::clearCaches();
unset( $wgContentHandlers['DUMMY'] );
MWNamespace::clearCaches();
- $wgContLang->resetNamespaces(); # reset namespace cache
+ // Reset namespace cache
+ $wgContLang->resetNamespaces();
}
protected function makeRevision( $props = null ) {
}
protected function makeRevision( $props = null ) {
}
public static function provideUserWasLastToEdit() {
}
public static function provideUserWasLastToEdit() {
- return [
- [ # 0
- 3, true, # actually the last edit
- ],
- [ # 1
- 2, true, # not the current edit, but still by this user
- ],
- [ # 2
- 1, false, # edit by another user
- ],
- [ # 3
- 0, false, # first edit, by this user, but another user edited in the mean time
- ],
- ];
+ yield 'actually the last edit' => [ 3, true ];
+ yield 'not the current edit, but still by this user' => [ 2, true ];
+ yield 'edit by another user' => [ 1, false ];
+ yield 'first edit, by this user, but another user edited in the mean time' => [ 0, false ];
'RevisionStorageTest_testUserWasLastToEdit', $ns ) );
$page->insertOn( $dbw );
'RevisionStorageTest_testUserWasLastToEdit', $ns ) );
$page->insertOn( $dbw );
$revisions[0] = new Revision( [
'page' => $page->getId(),
// we need the title to determine the page's default content model
$revisions[0] = new Revision( [
'page' => $page->getId(),
// we need the title to determine the page's default content model
] );
$revisions[0]->insertOn( $dbw );
] );
$revisions[0]->insertOn( $dbw );
$revisions[1] = new Revision( [
'page' => $page->getId(),
// still need the title, because $page->getId() is 0 (there's no entry in the page table)
$revisions[1] = new Revision( [
'page' => $page->getId(),
// still need the title, because $page->getId() is 0 (there's no entry in the page table)
] );
$revisions[1]->insertOn( $dbw );
] );
$revisions[1]->insertOn( $dbw );
$revisions[2] = new Revision( [
'page' => $page->getId(),
'title' => $page->getTitle(),
$revisions[2] = new Revision( [
'page' => $page->getId(),
'title' => $page->getTitle(),
] );
$revisions[2]->insertOn( $dbw );
] );
$revisions[2]->insertOn( $dbw );
$revisions[3] = new Revision( [
'page' => $page->getId(),
'title' => $page->getTitle(),
$revisions[3] = new Revision( [
'page' => $page->getId(),
'title' => $page->getTitle(),
] );
$revisions[3]->insertOn( $dbw );
] );
$revisions[3]->insertOn( $dbw );
$revisions[4] = new Revision( [
'page' => $page->getId(),
'title' => $page->getTitle(),
$revisions[4] = new Revision( [
'page' => $page->getId(),
'title' => $page->getTitle(),